/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Tema_4_arrays;

/**
 *
 * @author Alex
 */
public class Ejer_13_forma_2 {

    //
    public static void main(String[] args) {
  int [] v= {12,4,5,78,45,67,45,66,77,44};
        
        for (int i = 0; i < v.length-1; i++) {  //v.length-1 es para que no compara con 1 posicion fuera de rango del arrays
            
            if(v[i]>v[i+1])
            {
                int aux=v[i]; //variable que almacena el valor para intercambio
                v[i]=v[i+1];
                v[i+1]=aux;
            }
        }
    }  
}
